<template>
  <div class="parent-wrapper" v-if="parentData">
    <div class="parent-item">
      <parentComment v-if="parentData.parent" :parentData="parentData.parent"/>
      <div class="parent-info">
        {{parentData.account.nickname}}
        <i>{{parentData.account.created_at|fromDate}}</i>
        <span>{{parentData.level}}</span>
      </div>
      <div class="parent-content">
        {{parentData.content}}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props:['parentData'],
  name:'parentComment',
  filters:{
    fromDate(time){
       var moment = require('moment'); 
      return moment(time).format("YYYY-MM-DD hh:mm")
    }
  },
  created(){
    console.log(this.parentData,999999);
  }
}
</script>
<style lang="less" scoped>
.parent-item{
  padding: 2px;
  border: 1px solid #dddddd;
  background-color: #f9f9f9;
 
 .parent-content{
   padding: 16px 10px;
 }
 .parent-info{
   padding:0 10px;
   font-size: 12px;
   color: #999;
   display: flex;
   i{
     flex: 1;
   }
 }
}
</style>